from django.db import models

# Create your models here.
class User(models.Model):
    mobile = models.CharField(max_length=20)
    password = models.CharField(max_length=20)
    mon = models.DecimalField(max_digits=7,decimal_places=2,default=10000.00)
    def __str__(self):
        return self.mobile
    class Meta:
        db_table = 'user'
        verbose_name = ' 用户'

class Good(models.Model):
    img = models.CharField(max_length=50)
    title = models.CharField(max_length=20)
    price = models.CharField(max_length=20)
    def __str__(self):
        return self.title
    class Meta:
        db_table = 'good'
        verbose_name = ' 商品'

class Ding(models.Model):
    ii = models.CharField(max_length=20)
    name = models.CharField(max_length=20)
    img = models.CharField(max_length=20)
    price = models.DecimalField(max_digits=7,decimal_places=2)
    s = models.ForeignKey(to=User,on_delete=models.CASCADE)
    def __str__(self):
        return self.name
    class Meta:
        db_table = 'dingdan'
        verbose_name = ' 订单'